package a.e.a;

import java.io.IOException;
import java.io.Writer;
import java.util.Collection;
import java.util.Iterator;

public class g
{
  private int a;
  private Writer b;
  private StringBuffer d = new StringBuffer(100);
  private String e;
  public static int f;
  
  public g(Writer paramWriter)
  {
    this.d.append("\t\t\t\t");
    this.a = 0;
    this.b = paramWriter;
    this.e = System.getProperty("line.separator");
  }
  
  protected void a()
    throws IOException
  {
    boolean bool = r.f;
    int j = r.e;
    int i = c();
    do
    {
      do
      {
        if (this.d.length() >= i) {
          break;
        }
        this.d.append(this.d.toString());
        if ((!bool) && (j != 0)) {
          return;
        }
      } while (j == 0);
    } while (bool);
    this.b.write(this.d.toString(), 0, i);
  }
  
  public void a(String paramString)
    throws IOException
  {
    a();
    this.b.write(paramString);
    this.b.write(this.e);
    a();
    this.b.write("[" + this.e);
    this.a += 1;
  }
  
  protected void a(String paramString1, String paramString2)
    throws IOException
  {
    a();
    this.b.write(paramString1);
    this.b.write(9);
    this.b.write(paramString2);
    this.b.write(this.e);
  }
  
  public void a(String paramString, double paramDouble)
    throws IOException
  {
    boolean bool = r.f;
    if (!bool) {
      if (!Double.isInfinite(paramDouble))
      {
        if (!bool) {
          if (!Double.isNaN(paramDouble)) {
            break label47;
          }
        }
      }
      else
      {
        if (bool) {
          break label53;
        }
        a(paramString, "0");
      }
    }
    if (r.e != 0) {
      label47:
      label53:
      a(paramString, Double.toString(paramDouble));
    }
  }
  
  public void a(String paramString, int paramInt)
    throws IOException
  {
    a(paramString, Integer.toString(paramInt));
  }
  
  public void a(String paramString, Number paramNumber)
    throws IOException
  {
    boolean bool = r.f;
    if (!bool) {
      if (!Double.isInfinite(paramNumber.doubleValue()))
      {
        if (!bool) {
          if (!Double.isNaN(paramNumber.doubleValue())) {
            break label49;
          }
        }
      }
      else
      {
        if (bool) {
          break label55;
        }
        a(paramString, "0");
      }
    }
    if (r.e != 0) {
      label49:
      label55:
      a(paramString, paramNumber.toString());
    }
  }
  
  public void a(String paramString, boolean paramBoolean)
    throws IOException
  {
    a(paramString, paramBoolean ? "1" : "0");
  }
  
  public void b(String paramString1, String paramString2)
    throws IOException
  {
    a(paramString1, b(paramString2));
  }
  
  public void a(String paramString, Object paramObject)
    throws IOException
  {
    boolean bool = r.f;
    int i = r.e;
    if ((bool) || (paramObject != null))
    {
      if (!bool) {
        if ((paramObject instanceof Double))
        {
          a(paramString, ((Double)paramObject).doubleValue());
          if ((!bool) && (i == 0)) {
            return;
          }
        }
      }
      if (!bool) {
        if ((paramObject instanceof Integer))
        {
          a(paramString, ((Integer)paramObject).intValue());
          if ((!bool) && (i == 0)) {
            return;
          }
        }
      }
      if (!bool) {
        if ((paramObject instanceof Number))
        {
          a(paramString, ((Number)paramObject).doubleValue());
          if ((!bool) && (i == 0)) {
            return;
          }
        }
      }
      if (!bool) {
        if ((paramObject instanceof Collection))
        {
          a(paramString, "item", (Collection)paramObject);
          if (!bool) {
            if (i == 0) {
              return;
            }
          }
        }
        else
        {
          if (bool) {
            break label171;
          }
          b(paramString, paramObject.toString());
        }
      }
      if (i == 0) {
        return;
      }
    }
    label171:
    b(paramString, "null");
  }
  
  public void a(String paramString1, String paramString2, Collection paramCollection)
    throws IOException
  {
    boolean bool = r.f;
    int i = r.e;
    a(paramString1);
    Iterator localIterator = paramCollection.iterator();
    if (localIterator.hasNext()) {}
    while (bool)
    {
      a(paramString2, localIterator.next());
      if ((!bool) && (i != 0)) {
        return;
      }
      if (i == 0) {
        break;
      }
    }
    b();
  }
  
  protected String b(String paramString)
  {
    boolean bool = r.f;
    int m = r.e;
    int i = 0;
    int j = 0;
    label79:
    label87:
    do
    {
      if (j >= paramString.length()) {
        break;
      }
      k = paramString.charAt(j);
      if ((!bool) && (m != 0)) {
        break label101;
      }
      if (!bool)
      {
        if (k <= 127) {
          if (bool) {
            break label79;
          }
        }
      }
      else if (k != 38)
      {
        if (bool) {
          continue;
        }
        if (k != 34) {
          break label87;
        }
      }
      i = 1;
      if (!bool)
      {
        if (m == 0) {
          break;
        }
        j++;
      }
    } while (m == 0);
    if ((!bool) && (i == 0)) {
      label101:
      return '"' + paramString + '"';
    }
    StringBuffer localStringBuffer = new StringBuffer(paramString.length() + 9);
    localStringBuffer.append('"');
    int k = 0;
    label301:
    do
    {
      if (k >= paramString.length()) {
        break;
      }
      if (bool) {
        break label325;
      }
      char c = paramString.charAt(k);
      if (m != 0) {
        break label321;
      }
      if (!bool) {
        if (c > '')
        {
          localStringBuffer.append("&#x");
          localStringBuffer.append(Integer.toHexString(c));
          localStringBuffer.append(';');
          if (bool) {
            continue;
          }
          if (m == 0) {
            break label301;
          }
        }
      }
      if (!bool) {}
      switch (c)
      {
      case '"': 
        localStringBuffer.append("&quot;");
        if (bool) {
          continue;
        }
        if (m == 0) {
          break;
        }
      case '&': 
        localStringBuffer.append("&amp;");
        if (bool) {
          continue;
        }
        if (m == 0) {
          break;
        }
      default: 
        localStringBuffer.append(c);
      }
      k++;
    } while (m == 0);
    if (!bool) {
      localStringBuffer.append('"');
    }
    label321:
    label325:
    return localStringBuffer.toString();
  }
  
  public void b()
    throws IOException
  {
    this.a -= 1;
    a();
    this.b.write("]" + this.e);
  }
  
  public int c()
  {
    return this.a;
  }
}


/* Location:           E:\idea\
 * Qualified Name:     a.e.a.g
 * JD-Core Version:    0.7.0.1
 */